package net.xiduth.game.player.dialogues.towns.draynor;


import net.xiduth.game.player.dialogues.Dialogue;
import net.xiduth.utils.ShopsHandler;




/**
 * 
 * @author Josh' - Jul 14, 2013
 * 
 * Diango's toy store Dialogue
 * 
 */
public class Diango extends Dialogue {


    int npcId;
    
    @Override
    public void start() {
        npcId = (Integer) parameters[0];
        sendNPCDialogue(npcId, 9827, "Howdy there, partner.");
    }
    
    @Override
    public void run(int interfaceId, int componentId) {
        switch(stage) {
        case -1:
            sendPlayerDialogue(9827, "Hi, Diango.");
            stage = 1;
            break;
        case 1:
            sendNPCDialogue(npcId, 9827, "Want to see my spinning plates or kites? or do you ",
                    "want to check out my range of party items?");
            stage = 2;
            break;
        case 2:
            sendOptionsDialogue("Select an Option", "Spinning plates?", "Wow, a kite!", "Party items, you say?");
            stage = 3;
            break;
        case 3:
            switch(componentId) {
            case OPTION_1:
                sendPlayerDialogue(9827, "Spinning plates?");
                stage = 4;
                break;
            case OPTION_2:
                sendPlayerDialogue(9827, "Wow, a kite!");
                stage = 7;
                break;
            case OPTION_3:
                sendPlayerDialogue(9827, "Party items, you say?");
                stage = 13;
                break;
            }
        case 4:
            sendNPCDialogue(npcId, 9827, "That's right. There's a funny story behind them, their",
                    "shipment was held up by thieves.");
            stage = 5;
            break;
        case 5:
            sendNPCDialogue(npcId, 9827, "The crate was marked 'Dragon Plates'.",
                    "Apparently they thought it was some kind of armour,",
                    "when really it's just a plate with a dragon on it!");
            stage = 6;
            break;
        case 6:
            ShopsHandler.openShop(player, 3);
            player.getDialogueManager().finishDialogue();
            break;
        case 7:
            sendNPCDialogue(npcId, 9827, "You're not the first to say that...");
            stage = 8;
            break;
        case 8:
            sendPlayerDialogue(9827, "Can I have one, please?");
            stage = 9;
            break;
        case 9:
            sendNPCDialogue(npcId, 9827, "Well, I suppose I did order more than I need... It's yours",
                    "for the bargain price of 100 coins.");
            stage = 10;
            break;
        case 10:
            sendOptionsDialogue("Select an Option", "That's a bargain! I'll take one.", "No, thanks, I don't want one.");
            stage = 11;
            break;
        case 11:
            switch(componentId) {
            case OPTION_1:
                sendPlayerDialogue(9827, "That's a bargain! I'll take one.", "No, thanks, I don't want one.");
                stage = 12;
                break;
            case OPTION_2:
                sendPlayerDialogue(9827, "No, thanks, I don't want one.");
                stage = 99;
                break;
            }
        case 12:
            ShopsHandler.openShop(player, 3);
            player.getDialogueManager().finishDialogue();
            break;
        case 13:
            sendNPCDialogue(npcId, 9827, "Yep! In a partnership with my pal Party Pete, we've",
                    "decided to launch a whole range of partyware to help",
                    "celebrate the Royal Wedding of the King Black Dragon and",
                    "the Kalphite Queen. Confetti, bubble makers, fireworks,");
            stage = 14;
            break;
        case 14:
            sendNPCDialogue(npcId, 9827, "firecrackers. We even have a commemorative mug!");
            stage = 15;
            break;
        case 15:
            sendPlayerDialogue(9827, "King Black Dragon and Kalphite... Wait, what?");
            stage = 16;
            break;
        case 16:
            sendNPCDialogue(npcId, 9827, "Er, well, that's what I was told; perhaps our providers got",
                    "it wrong. Mind you, it wouldn't be the first time. Like, this,",
                    "once, we were due to recieve a shipment of dragonmail,",
                    "and we got a pile of slightly singed letters instead.");
            stage = 17;
            break;
        case 17:
            sendNPCDialogue(npcId, 9827, "Anyway, we've got all those items on sale, and I even have",
                    "a suitable bouquet avaliable for those who want to",
                    "emulate the happy bride!");
            stage = 18;
            break;
        case 18:
            sendPlayerDialogue(9827, "She had a bouquet? The Kalphite Queen? Big bug, beady-",
                    "eyes, occasionally flies about when it's not laying eggs?",
                    "Are we talking about the same creature?");
            stage = 19;
            break;
        case 19:
            sendNPCDialogue(npcId, 9827, "Listen, partner, I'm not the one writing the advertising",
                    "pitch here. I got the goods and been told what to say in",
                    "order to sell them. It's not the most convincing pitch I've",
                    "ever had to do, but, if you ask me, the products don't");
            stage = 20;
            break;
        case 20: 
            sendNPCDialogue(npcId, 9827, "need a pitch. They speak for themselves. Have a butchers.");
            stage = 12;
            break;
        case 99:
            player.getDialogueManager().finishDialogue();
            break;
        }
    }


    @Override
    public void finish() {
        
    }
}